home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 24 / AACD 24.iso / AACD / Games / dynAMIte / Developer / E / dynAMIte.e < prev    next >
Text File  |  2001-07-22  |  8KB  |  241 lines

  1. -> NOREV
  2. OPT MODULE
  3. OPT EXPORT
  4.  
  5. MODULE  'exec/nodes',
  6.         'exec/lists',
  7.         'exec/semaphores'
  8.  
  9. -> player.status
  10. ENUM  PA_NONE=0, -> no player
  11.       PA_VISI,   -> player is visitor
  12.       PA_LOGGEDIN, -> player just logged in/after a game
  13.       PA_PLAYING,  -> player is in game (no matter if he's dead)
  14.       PA_COUNTDOWN, -> this is of no use. players only have this status if they logged in.
  15.       PA_DEAD, -> this is of no use, it's not meant to see if a player is
  16.                -> actually dead.  use player.dead instead.  it's only set
  17.                -> after a successfull login for the other players
  18.       PA_WON -> a player has this status if he won the last round
  19.  
  20. -> dynasema.gamerunning
  21. ENUM  GAME_CLOSEGAME=0, -> transitional state to GAME_NOTCONNECTED after connection got closed
  22.       GAME_MENU,        -> game is in menu eg: login screen
  23.       GAME_ENDGAME,     -> transitional state to GAME_MENU after effect has been drawn
  24.       GAME_EFFECT,      -> game draws effect after a match
  25.       GAME_COUNTDOWN,   -> game is doing the countdown
  26.       GAME_GAME,        -> game is running
  27.       GAME_HURRYUP,     -> game is running and is in hurry up mode
  28.       GAME_NOTCONNECTED -> game is not connected (startscreen)
  29.  
  30. ENUM  DIR_NONE=-1,
  31.       DIR_DOWN,
  32.       DIR_RIGHT,
  33.       DIR_LEFT,
  34.       DIR_UP
  35.  
  36. CONST SPEED_NORMAL=4,
  37.       SPEED_SLOW=3,
  38.       SPEED_FAST=6
  39.  
  40. CONST BLOCK_FAKEBLOCK=-1,    -> used for remote/kick bombs which are placed into the map
  41.       BLOCK_NOBLOCK=0,       -> empty field
  42.       BLOCK_HARDBLOCK=1,     -> non-destroyable block
  43.       BLOCK_DESTROYABLE=2,   -> destroyable block
  44.       BLOCK_BOMB=3,          -> normal bomb
  45.       BLOCK_BORDERWALL1=4,   -> borderblocks are equal to hardblock
  46.       BLOCK_BORDERWALL2=5,
  47.       BLOCK_BORDERWALL3=6,
  48.       BLOCK_BORDERWALL4=7,
  49.       BLOCK_BORDERWALL5=8,
  50.       BLOCK_BORDERWALL6=10,
  51.       BLOCK_BORDERWALL7=11,
  52.       BLOCK_BORDERWALL8=12,
  53.       BLOCK_BORDERWALL9=13,
  54.       BLOCK_BORDERWALL10=14,
  55.       BLOCK_BORDERWALL11=15,
  56.       BLOCK_BORDERWALL12=16,
  57.  
  58.       BLOCK_ADDBOMB=19    -> block which contains a bomb
  59.  
  60. ENUM  BO_EXPANDFLAME=1, -> types for bonusgrid
  61.       BO_ADDBOMB,
  62.       BO_FLAMEMAX,
  63.       BO_BOMBMAX,
  64.       BO_RANDOMWALL,  -> 5
  65.       BO_BOMBS2BLOCKS,
  66.       BO_DROPALL,
  67.       BO_EXPLALL,
  68.       BO_FASTER,
  69.       BO_SLOWER,      -> 10
  70.       BO_SHORTERFUSE,
  71.       BO_LONGERFUSE,
  72.       BO_SHORTERFLAME,
  73.       BO_SWAPCONTROLSRL,
  74.       BO_FEWERBOMBS,  -> 15
  75.       BO_NODROP,
  76.       BO_SHIELD,
  77.       BO_STANDSTILL,
  78.       BO_TELEPORT,
  79.       BO_REMOTEBOMB,  -> 20
  80.       BO_BACK2BASIC,
  81.       BO_KICKBOMB,
  82.       BO_SABER,
  83.       BO_SWAPCONTROLSUD,
  84.       BO_MAGNET,      -> 25
  85.       BO_PHOENIX,
  86.       BO_DOHURRYUP,
  87.       BO_INVISIBLE,
  88.       BO_DUELL,
  89.       BO_AFTERBURNER,  -> 30
  90.       BO_FLAG,
  91.       BO_TELEPORTALL,
  92.       BO_MAPJUMP,
  93.       BO_RESTARTMAP,
  94.       BO_SWAPPOSITIONS, -> 35
  95.       BO_MAX
  96.  
  97. -> types for tempbomb.type
  98. ENUM  BOMB_NORMAL=0,  -> normal bomb
  99.       BOMB_GEN,       -> predefined bomb (map)
  100.       BOMB_REMOTE,    -> remote bomb
  101.       BOMB_KICK       -> kick bomb
  102.  
  103. OBJECT serverdata
  104.   servername[34]:ARRAY -> name of the server
  105.   sysopname[18]:ARRAY  -> name of the sysop
  106.   maxslots:INT         -> how many players allows this server
  107.   maxobservers:INT     -> how many observers allows this server
  108. ENDOBJECT
  109.  
  110. OBJECT tempbomb
  111.   ln:mln
  112.  
  113.   x:INT -> x blockpos
  114.   y:INT -> y blockpos
  115.  
  116.   x1:INT -> x pos (pixel)
  117.   y1:INT -> y pos (pixel)
  118.  
  119.   fuse:INT -> >0 bomb is still ticking; =0 bomb is going to explode
  120.   range:LONG -> flamlength
  121.  
  122.   dir:INT -> in case of kick/remote bomb holds the direction
  123.  
  124.   originx:INT -> holds the x/y pos (block) where the bomb was placed
  125.   originy:INT -> (useful to find kick/remotebombs)
  126.  
  127.   type:INT -> is set to one of BOMB_#?
  128.  
  129.   /******* private data *******/
  130.  
  131. ENDOBJECT
  132.  
  133. OBJECT player
  134.   num:INT
  135.   status:LONG -> this is set to one of PA_#?
  136.  
  137.   dead:INT -> >0 = player is alive
  138.  
  139.   x:INT -> xpos (pixel) + border (24 pixel)
  140.   y:INT -> ypos (pixel) + border (16 pixel)
  141.  
  142.   px:INT -> xpos (block number)
  143.   py:INT -> ypos (block number)
  144.  
  145.   bombc:INT -> how many bombs this player has currently ticking
  146.   maxkickbombs:INT -> how many kickbombs this player has
  147.   bomblist:PTR TO mlh -> doubly linked list of bombs belonging to this player
  148.  
  149.   remotebomb:PTR TO tempbomb -> pointer to a bomb of bomblist which is his remotebomb else 0
  150.   kickbomb:PTR TO tempbomb -> pointer to a bomb of bomblist which is his kickbomb else 0
  151.  
  152.   maxrange:INT -> flamelen of player ranging from 2 to 15
  153.   maxbombs:INT -> how many bombs this player can drop
  154.   fuselen:INT -> fuselength of bombs the player can drop
  155.   speed:INT -> player speed; SPEED_NORMAL=4, SPEED_SLOW=3, SPEED_FAST=6
  156.   speedc:INT -> >0 = player has other speed (SPEED_SLOW, SPEED_FAST)
  157.  
  158.   swaprlc:INT -> >0 = swaped horizontal controls
  159.   swapudc:INT -> >0 = swaped vertical controls
  160.   nodropc:INT -> >0 = player can't drop bombs
  161.  
  162.   shieldc:INT -> >0 = player has shield
  163.  
  164.   standstillc:INT -> >0 = player can't move
  165.  
  166.   invisiblec:INT -> >0 = player is invisible
  167.  
  168.   afterburnerc:INT -> >0 = player has afterburner
  169.  
  170.   b2bc:INT
  171.  
  172.   flamethrowerc:INT -> >0 = player has lightsabre
  173.   flamethrowerdir:INT -> direction of lightsabre
  174.   flamethrowerr:INT -> range of light sabre
  175.  
  176.   magnetc:INT -> >0 = this player has magnet enabled
  177.   magnetdir:INT -> direction of magnet
  178.  
  179.   name[34]:ARRAY -> players name
  180.   system[64]:ARRAY -> players systemstring
  181.  
  182.   /******* private data *******/
  183.  
  184. ENDOBJECT
  185.  
  186. OBJECT dynamitesemaphore
  187.   sema:ss -> embedded signalsemaphore
  188.  
  189.   opencnt:LONG -> you must increase this by 1 if you are going to use the
  190.                -> semaphore the first time. decrease it by 1 if you are done
  191.  
  192.   quit:LONG -> dynamite will set this to 1 if it wants to quit.  Check this
  193.             -> from time to time and end your program if quit gets set to 1
  194.  
  195.   gamerunning:LONG -> is set to one of GAME_#?
  196.  
  197.   frames:LONG -> once a game is running this long will be increased by 1
  198.               -> every frame.
  199.  
  200.   walk:LONG     -> set to one of DIR_ to make the player move or stop
  201.   drop:LONG     -> set to 1 to drop a bomb
  202.   dropkick:LONG -> set to 1 to drop a kickbomb
  203.  
  204.   thisplayer:LONG -> number of this player in playerarray (>7 = observer)
  205.   player:PTR TO LONG -> array ptr of players (15 entries max; >7 = observer)
  206.  
  207.   mapwidth:LONG  -> holds the width of the map in blocks
  208.   mapheight:LONG -> holds the height of the map in blocks
  209.  
  210.   grid:PTR TO LONG -> array ptr to the actual map (29 entries max). each entry contains 1 line of the map without powerups
  211.                    -> each element of line is INT sized
  212.  
  213.   bonusgrid:PTR TO LONG -> array ptr to the bonus map (29 entries max). each entry contains 1 line of the bonusmap
  214.                         -> each element of line is CHAR sized
  215.  
  216.   addbubble:PTR TO CHAR -> setting this pointer to a string will make
  217.                         -> dynamite show the string given here as bubble.
  218.                         -> dynamite will reset this pointer to 0 after
  219.                         -> successfull creation of the bubble
  220.  
  221.   serverdata:PTR TO serverdata -> see serverdata for details
  222.  
  223.   explosiongrid:PTR TO LONG -> array ptr to the explosion map (29 entries max). each entry contains 1 line of the explosion map
  224.                             -> this map reflects where currently explosions are (explosion=1)
  225.                             -> each element of line is CHAR sized
  226.  
  227.   version:LONG -> holds the version of dynamite (e.g. 45)
  228.  
  229.   botinfo:PTR TO LONG -> pointer to an array of 255 (so 255 bots max are
  230.                       -> supported with this array) long pointers to hold a
  231.                       -> string (versioninfo, description) of your bot.
  232.                       -> You should set the entry for your bot after
  233.                       -> opencnt has been increased by your bot and set it
  234.                       -> back to NULL if your bot is about to decrease the
  235.                       -> opencnt again on quit.
  236.  
  237.                       -> entry for your bot in this array is opencnt after
  238.                       -> increasing (on botstartup, see example)
  239.  
  240. ENDOBJECT
  241.